//
//  OAuthModelText.m
//  WeiBTest
//
//  Created by Zc_zhou on 15/9/14.
//  Copyright (c) 2015年 Apple. All rights reserved.
//

#import "OAuthModelText.h"

@implementation OAuthModelText

+(instancetype)accountWith:(NSDictionary *)dict
{
    OAuthModelText * account = [[OAuthModelText alloc] init];
    account.access_token = dict[@"access_token"];
    account.expires_in = dict[@"expires_in"];
    account.uid = dict[@"uid"];
    
    return account;
}

-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.access_token forKey:@"access_token"];
    [aCoder encodeObject:self.expires_in forKey:@"expires_in"];
    [aCoder encodeObject:self.uid forKey:@"uid"];
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super init]) {
        self.access_token = [aDecoder decodeObjectForKey:@"access_token"];
        self.expires_in = [aDecoder decodeObjectForKey:@"expires_in"];
        self.uid = [aDecoder decodeObjectForKey:@"uid"];

    }
    return self;
    
}
@end
